<template>
	<div>
		<p>学习生命周期 - 看控制台打印</p>
		<p id="myP">{{ msg }}</p>

	</div>
</template>

<script>
	export default {
		data() {
			return {
				msg: "hello, Vue",
			}
		},
		//创建阶段
		beforeCreate(){
			console.log('执行了----beforeCreate',this.msg);
		},
		created(){
			console.log('执行了----created',this.msg);
		},
		//挂载阶段
		beforeMount(){
			console.log('执行了----beforeMount',document.querySelector('#myP'));
		},
		mounted(){
			console.log('执行了----mounted',document.querySelector('#myP'));
		}
	}
</script>

<style>

</style>
